Integrand size = 41, antiderivative size = 107 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2 \left (A b^2-a (b B-a C)\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b} d}-\frac {(A b-a B) \text {arctanh}(\sin (c+d x))}{a^2 d}+\frac {A \tan (c+d x)}{a d} \]
-(A*b-B*a)*arctanh(sin(d*x+c))/a^2/d+2*(A*b^2-a*(B*b-C*a))*arctan((a-b)^(1 /2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/a^2/d/(a-b)^(1/2)/(a+b)^(1/2)+A*tan(d* x+c)/a/d
Result contains complex when optimal does not.
Time = 3.94 (sec) , antiderivative size = 339, normalized size of antiderivative = 3.17 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {2 \cos ^2(c+d x) \left (C+B \sec (c+d x)+A \sec ^2(c+d x)\right ) \left ((A b-a B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+(-A b+a B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-\frac {2 i \left (A b^2+a (-b B+a C)\right ) \arctan \left (\frac {(i \cos (c)+\sin (c)) \left (b \sin (c)+(-a+b \cos (c)) \tan \left (\frac {d x}{2}\right )\right )}{\sqrt {-\left (\left (a^2-b^2\right ) (\cos (c)-i \sin (c))^2\right )}}\right ) (\cos (c)-i \sin (c))}{\sqrt {\left (-a^2+b^2\right ) (\cos (c)-i \sin (c))^2}}+\frac {a A \sin \left (\frac {d x}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {a A \sin \left (\frac {d x}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{a^2 d (2 A+C+2 B \cos (c+d x)+C \cos (2 (c+d x)))} \]
(2*Cos[c + d*x]^2*(C + B*Sec[c + d*x] + A*Sec[c + d*x]^2)*((A*b - a*B)*Log [Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + (-(A*b) + a*B)*Log[Cos[(c + d*x)/2 ] + Sin[(c + d*x)/2]] - ((2*I)*(A*b^2 + a*(-(b*B) + a*C))*ArcTan[((I*Cos[c ] + Sin[c])*(b*Sin[c] + (-a + b*Cos[c])*Tan[(d*x)/2]))/Sqrt[-((a^2 - b^2)* (Cos[c] - I*Sin[c])^2)]]*(Cos[c] - I*Sin[c]))/Sqrt[(-a^2 + b^2)*(Cos[c] - I*Sin[c])^2] + (a*A*Sin[(d*x)/2])/((Cos[c/2] - Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) + (a*A*Sin[(d*x)/2])/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))))/(a^2*d*(2*A + C + 2*B*Cos[c + d*x] + C*Co s[2*(c + d*x)]))
Time = 0.65 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.05, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {3042, 3534, 25, 3042, 3480, 3042, 3138, 218, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^2(c+d x) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a+b \cos (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx\) |
\(\Big \downarrow \) 3534 |
\(\displaystyle \frac {\int -\frac {(A b-a B-a C \cos (c+d x)) \sec (c+d x)}{a+b \cos (c+d x)}dx}{a}+\frac {A \tan (c+d x)}{a d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\int \frac {(A b-a B-a C \cos (c+d x)) \sec (c+d x)}{a+b \cos (c+d x)}dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\int \frac {A b-a B-a C \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx}{a}\) |
\(\Big \downarrow \) 3480 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\frac {(A b-a B) \int \sec (c+d x)dx}{a}-\frac {\left (A b^2-a (b B-a C)\right ) \int \frac {1}{a+b \cos (c+d x)}dx}{a}}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\frac {(A b-a B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a}-\frac {\left (A b^2-a (b B-a C)\right ) \int \frac {1}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a}}{a}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\frac {(A b-a B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a}-\frac {2 \left (A b^2-a (b B-a C)\right ) \int \frac {1}{(a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}d\tan \left (\frac {1}{2} (c+d x)\right )}{a d}}{a}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\frac {(A b-a B) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a}-\frac {2 \left (A b^2-a (b B-a C)\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}}}{a}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {A \tan (c+d x)}{a d}-\frac {\frac {(A b-a B) \text {arctanh}(\sin (c+d x))}{a d}-\frac {2 \left (A b^2-a (b B-a C)\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}}}{a}\) |
-(((-2*(A*b^2 - a*(b*B - a*C))*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[ a + b]])/(a*Sqrt[a - b]*Sqrt[a + b]*d) + ((A*b - a*B)*ArcTanh[Sin[c + d*x] ])/(a*d))/a) + (A*Tan[c + d*x])/(a*d)
3.10.82.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_ .)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[(A*b - a*B)/(b*c - a*d) Int[1/(a + b*Sin[e + f*x]), x], x] + Simp[(B*c - A*d)/ (b*c - a*d) Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f , A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x ]*(a + b*Sin[e + f*x])^(m + 1)*((c + d*Sin[e + f*x])^(n + 1)/(f*(m + 1)*(b* c - a*d)*(a^2 - b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 - b^2)) Int [(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[(m + 1)*(b*c - a* d)*(a*A - b*B + a*C) + d*(A*b^2 - a*b*B + a^2*C)*(m + n + 2) - (c*(A*b^2 - a*b*B + a^2*C) + (m + 1)*(b*c - a*d)*(A*b - a*B + b*C))*Sin[e + f*x] - d*(A *b^2 - a*b*B + a^2*C)*(m + n + 3)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b , c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -1] && ((EqQ[a, 0] && IntegerQ[m] && !IntegerQ [n]) || !(IntegerQ[2*n] && LtQ[n, -1] && ((IntegerQ[n] && !IntegerQ[m]) | | EqQ[a, 0])))
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.34 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.41
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (A \,b^{2}-B a b +a^{2} C \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {A}{a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2}}-\frac {A}{a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (A b -B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2}}}{d}\) | \(151\) |
default | \(\frac {\frac {2 \left (A \,b^{2}-B a b +a^{2} C \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {A}{a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2}}-\frac {A}{a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (A b -B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2}}}{d}\) | \(151\) |
risch | \(\frac {2 i A}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) A \,b^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,a^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) B b}{\sqrt {-a^{2}+b^{2}}\, d a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) A \,b^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,a^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) B b}{\sqrt {-a^{2}+b^{2}}\, d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {-a^{2}+b^{2}}\, a}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A b}{a^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A b}{a^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{a d}\) | \(544\) |
1/d*(2*(A*b^2-B*a*b+C*a^2)/a^2/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d* x+1/2*c)/((a-b)*(a+b))^(1/2))-A/a/(tan(1/2*d*x+1/2*c)+1)+1/a^2*(-A*b+B*a)* ln(tan(1/2*d*x+1/2*c)+1)-A/a/(tan(1/2*d*x+1/2*c)-1)+(A*b-B*a)/a^2*ln(tan(1 /2*d*x+1/2*c)-1))
Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (96) = 192\).
Time = 3.12 (sec) , antiderivative size = 470, normalized size of antiderivative = 4.39 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\left [-\frac {{\left (C a^{2} - B a b + A b^{2}\right )} \sqrt {-a^{2} + b^{2}} \cos \left (d x + c\right ) \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - {\left (B a^{3} - A a^{2} b - B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (B a^{3} - A a^{2} b - B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (A a^{3} - A a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d \cos \left (d x + c\right )}, \frac {2 \, {\left (C a^{2} - B a b + A b^{2}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right ) + {\left (B a^{3} - A a^{2} b - B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a^{3} - A a^{2} b - B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{3} - A a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d \cos \left (d x + c\right )}\right ] \]
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2/(a+b*cos(d*x+c)),x, algorithm="fricas")
[-1/2*((C*a^2 - B*a*b + A*b^2)*sqrt(-a^2 + b^2)*cos(d*x + c)*log((2*a*b*co s(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x + c) - a^2 + 2*b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) - (B*a^3 - A*a^2*b - B*a*b^2 + A*b^3)*cos(d*x + c)*log(sin(d* x + c) + 1) + (B*a^3 - A*a^2*b - B*a*b^2 + A*b^3)*cos(d*x + c)*log(-sin(d* x + c) + 1) - 2*(A*a^3 - A*a*b^2)*sin(d*x + c))/((a^4 - a^2*b^2)*d*cos(d*x + c)), 1/2*(2*(C*a^2 - B*a*b + A*b^2)*sqrt(a^2 - b^2)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2)*sin(d*x + c)))*cos(d*x + c) + (B*a^3 - A*a^2*b - B*a*b^2 + A*b^3)*cos(d*x + c)*log(sin(d*x + c) + 1) - (B*a^3 - A*a^2*b - B*a*b^2 + A*b^3)*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*(A*a^3 - A*a*b^2 )*sin(d*x + c))/((a^4 - a^2*b^2)*d*cos(d*x + c))]
\[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\int \frac {\left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}}{a + b \cos {\left (c + d x \right )}}\, dx \]
Exception generated. \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2/(a+b*cos(d*x+c)),x, algorithm="maxima")
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.34 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.68 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\frac {\frac {{\left (B a - A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac {{\left (B a - A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} - \frac {2 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a} - \frac {2 \, {\left (C a^{2} - B a b + A b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{2}}}{d} \]
((B*a - A*b)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^2 - (B*a - A*b)*log(abs( tan(1/2*d*x + 1/2*c) - 1))/a^2 - 2*A*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a) - 2*(C*a^2 - B*a*b + A*b^2)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1 /2*c))/sqrt(a^2 - b^2)))/(sqrt(a^2 - b^2)*a^2))/d
Time = 8.66 (sec) , antiderivative size = 3483, normalized size of antiderivative = 32.55 \[ \int \frac {\left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx=\text {Too large to display} \]
(atan((((A*b - B*a)*((32*tan(c/2 + (d*x)/2)*(2*A^2*b^5 - B^2*a^5 - C^2*a^5 - 4*A^2*a*b^4 + 3*B^2*a^4*b + C^2*a^4*b + 3*A^2*a^2*b^3 - A^2*a^3*b^2 + 2 *B^2*a^2*b^3 - 4*B^2*a^3*b^2 - 4*A*B*a*b^4 + 2*A*B*a^4*b + 2*B*C*a^4*b + 8 *A*B*a^2*b^3 - 6*A*B*a^3*b^2 + 2*A*C*a^2*b^3 - 2*A*C*a^3*b^2 - 2*B*C*a^3*b ^2))/a^2 + ((A*b - B*a)*((32*(B*a^7 + C*a^7 - A*a^4*b^3 + 2*A*a^5*b^2 + B* a^5*b^2 + C*a^5*b^2 - A*a^6*b - 2*B*a^6*b - 2*C*a^6*b))/a^3 - (32*tan(c/2 + (d*x)/2)*(A*b - B*a)*(2*a^6*b + 2*a^4*b^3 - 4*a^5*b^2))/a^4))/a^2)*1i)/a ^2 + ((A*b - B*a)*((32*tan(c/2 + (d*x)/2)*(2*A^2*b^5 - B^2*a^5 - C^2*a^5 - 4*A^2*a*b^4 + 3*B^2*a^4*b + C^2*a^4*b + 3*A^2*a^2*b^3 - A^2*a^3*b^2 + 2*B ^2*a^2*b^3 - 4*B^2*a^3*b^2 - 4*A*B*a*b^4 + 2*A*B*a^4*b + 2*B*C*a^4*b + 8*A *B*a^2*b^3 - 6*A*B*a^3*b^2 + 2*A*C*a^2*b^3 - 2*A*C*a^3*b^2 - 2*B*C*a^3*b^2 ))/a^2 - ((A*b - B*a)*((32*(B*a^7 + C*a^7 - A*a^4*b^3 + 2*A*a^5*b^2 + B*a^ 5*b^2 + C*a^5*b^2 - A*a^6*b - 2*B*a^6*b - 2*C*a^6*b))/a^3 + (32*tan(c/2 + (d*x)/2)*(A*b - B*a)*(2*a^6*b + 2*a^4*b^3 - 4*a^5*b^2))/a^4))/a^2)*1i)/a^2 )/((64*(A^3*b^5 + B*C^2*a^5 - B^2*C*a^5 - A^3*a*b^4 + B^3*a^4*b - B^3*a^3* b^2 - 3*A^2*B*a*b^4 - A*C^2*a^4*b + A^2*C*a*b^4 - B*C^2*a^4*b + 3*A*B^2*a^ 2*b^3 - 3*A*B^2*a^3*b^2 + 3*A^2*B*a^2*b^3 + A*C^2*a^3*b^2 - A^2*C*a^3*b^2 + B^2*C*a^3*b^2 + 2*A*B*C*a^4*b - 2*A*B*C*a^2*b^3))/a^3 + ((A*b - B*a)*((3 2*tan(c/2 + (d*x)/2)*(2*A^2*b^5 - B^2*a^5 - C^2*a^5 - 4*A^2*a*b^4 + 3*B^2* a^4*b + C^2*a^4*b + 3*A^2*a^2*b^3 - A^2*a^3*b^2 + 2*B^2*a^2*b^3 - 4*B^2...